<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app"><!--v-on绑定事件-->
    <button v-on:click="sayHi">click Me</button>

</div>

<!--导入Vue.js-->

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<script>

    var vm = new Vue({
        el: "#app",
        data: {
            message: "张三学vue"
        },
        methods: {
            sayHi: function (event) {
                alert(this.message);
            }
        }

    });
</script>
</body>
</html>